package com.ibigcat.module.mdm.dao.mapper;

import java.util.*;

import com.ibigcat.framework.common.pojo.PageResult;
import com.ibigcat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ibigcat.framework.mybatis.core.mapper.BaseMapperX;
import com.ibigcat.module.mdm.dao.entity.PlatformDO;
import org.apache.ibatis.annotations.Mapper;
import com.ibigcat.module.mdm.controller.admin.platform.vo.*;

/**
 * 平台管理 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PlatformMapper extends BaseMapperX<PlatformDO> {

    default PageResult<PlatformDO> selectPage(PlatformPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PlatformDO>()
                .likeIfPresent(PlatformDO::getPlatformName, reqVO.getPlatformName())
                .eqIfPresent(PlatformDO::getPlatformCode, reqVO.getPlatformCode())
                .eqIfPresent(PlatformDO::getDisabled, reqVO.getDisabled())
                .betweenIfPresent(PlatformDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PlatformDO::getId));
    }

}